<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
var containsDuplicate = function(nums) {

    L = nums.length
    var set = new Set(nums)
    if( set.size !== L ){
        return true
    }else{
        return false
    }

};

var nums = [1,2,3,1]
console.log(containsDuplicate(nums))
    </script>
</body>
</html>